package eu.webhib.frmwrk.servlet;

import javax.servlet.http.*;
//
public abstract class AbstractApplication {

   static protected AbstractApplication instance = null;

   public AbstractApplication() {
      // singleton only one instance allowed
      assert (instance == null);
   }

   protected static void setInstance(AbstractApplication inst) {
      // singleton only one instance allowed
      assert (instance == null);
      instance = inst;
   }

   public static AbstractApplication getInstance() {
      assert (instance != null);
      return instance;
   }

   /**
    * Deliver page URL to application at the end of the request
    */
   abstract public void setRequestFinished(HttpServletRequest request, String pagePath);

   /**
    * Return the error page of the application
    */
   abstract public String getErrorPageURI();
}
